Skip to content

fix: accept conftest.py as alternative to context.py, document test separation#36

Merged
TheRealAgentK merged 2 commits intomasterfrom
fix/context-py-conftest-alternative
Apr 20, 2026
Merged

fix: accept conftest.py as alternative to context.py, document test separation#36
TheRealAgentK merged 2 commits intomasterfrom
fix/context-py-conftest-alternative

Conversation

@TheRealAgentK
Copy link
Copy Markdown
Collaborator

Summary

Two changes: a validation fix and documentation updates, both supporting the automated testing work in autohive-integrations PR #250.


1. Fix: Accept conftest.py as alternative to context.py

Problem: validate_integration.py requires tests/context.py as a hard dependency. Integrations that have migrated to pytest use tests/conftest.py instead (for pytest fixture setup), and the validator fails with:

❌ Missing tests/context.py (Test context/import setup)

Fix: The validator now accepts either tests/context.py (legacy) or tests/conftest.py (pytest). At least one must be present.

Files changed:

  • scripts/validate_integration.py — validation logic
  • scripts/docs/validate_integration.md — updated checks table
  • INTEGRATION_CHECKLIST.md — added conftest.py to lint suppression table

Context: 84 of 86 integrations still use context.py. Three integrations (hackernews, bitly, perplexity) have migrated to conftest.py as part of the pytest testing prototype. This change is backwards-compatible — existing integrations are unaffected.


2. Docs: Unit/integration test separation

Documents the two-tier testing approach established in the integrations repo:

Unit tests Integration tests
File naming test_*_unit.py test_*_integration.py
Marker @pytest.mark.unit @pytest.mark.integration
Runs in CI Yes (via run_tests.py) Never
Auto-discovered Yes No — explicit file path required
Credentials No (mocked) Yes (from .env)

Files changed:

  • LOCAL_DEVELOPMENT.md — added "Running Tests" section, added run_tests.py to CI table (was missing), updated required files list
  • README.md — added note that run_tests.py is unit-only, updated required files list
  • scripts/docs/run_tests.md — added "Unit Tests Only" section clarifying scope

…idation

Integrations using pytest can use tests/conftest.py instead of the legacy
tests/context.py for test import/fixture setup. The validator now accepts
either file — at least one must be present.
…iles

- Add 'Running Tests' section to LOCAL_DEVELOPMENT.md (unit vs integration)
- Add run_tests.py step to CI table in LOCAL_DEVELOPMENT.md
- Add 'Unit Tests Only' section to scripts/docs/run_tests.md
- Add note to README.md that run_tests.py is unit-only
- Update required files lists: tests/context.py or tests/conftest.py
@TheRealAgentK TheRealAgentK merged commit 13371ec into master Apr 20, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants